package com.xiu.weixin.service.user;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.xiu.weixin.mapper.UserMapper;
import com.xiu.weixin.pojo.User;

@Service
@Transactional
public class UsersServiceImpl implements UserService {
	@Autowired
	private UserMapper userMapper;

	@Override
	public void addUser(User user) {
		this.userMapper.insertUser(user);
	}

	@Override
	public List<User> findUserAll() {
		return this.userMapper.selectUsersAll();
	}

	@Override
	public User findUserById(Integer id) {
		return this.userMapper.selectUsersById(id);
	}

	@Override
	public void updateUser(User user) {
		this.userMapper.updateUser(user);
	}

	@Override
	public void deleteUserById(Integer id) {
		this.userMapper.deleteUserById(id);
	}
}